//
//  STCalendarKitView.h
//  STNewTools
//
//  Created by stoneobs on 2017/7/20.
//  Copyright © 2017年 stoneobs. All rights reserved.
//
//**********************关于setContentOffSet 会偶尔导致闪现的问题，准备大改，重写layout，改为一个collectionviewCell 不在嵌套使用***************************
#import <UIKit/UIKit.h>
#import "STCalendarKit.h"

@class STCalendarKitView;
@protocol STCalendarKitViewDlegate <NSObject>
@optional;
- (NSInteger)numberOfAutoAddDataSouceNumbersFromCalendarKitView:(STCalendarKitView*)calendarKitView;

- (NSInteger)numberOfAutoAddDataSouceLeftMonthsFromCalendarKitView:(STCalendarKitView*)calendarKitView;
/**
 数据已经计算完毕，准备渲染，可以更改此数据中是否存在日程

 @param calendarKitView calendarKitView description
 @param willDisplayArray willDisplayArray description
 */
- (void)calendarKitViewDidCalculatorData:(STCalendarKitView*)calendarKitView
                        willDisplayArray:(NSMutableArray<STCalendarKitMonthModel*> *)willDisplayArray;
/**
 已经减速完毕，滑动到了某个位置

 @param calendarKitView calendarKitView description
 @param mainIndexPath 主cell中的位置
 @param copyMonthModel 当前位置模型，copy而来，你无法通过修改这个模型改变初始数据
 */
- (void)calendarKitViewDidEndScroll:(STCalendarKitView*)calendarKitView
                      mainIndexPath:(NSIndexPath*)mainIndexPath
                     copyMonthModel:(STCalendarKitMonthModel*)copyMonthModel;


/**
 点击了当前cell 中上一个月的button

 @param calendarKitView calendarKitView description
 @param mainIndexPath mainIndexPath description
 @param itemIndexPath 被点击button 的indexPath
 @param copyDayModel copyDayModel copy
 des:调用calendarKitView 滑动到某天的方法，然后主动设置某天的模型成选中状态
 */
- (void)calendarKitViewDidclicTheLastMonthItem:(STCalendarKitView*)calendarKitView
                                 mainIndexPath:(NSIndexPath*)mainIndexPath
                                 itemIndexPath:(NSIndexPath*)itemIndexPath
                                  copyDayModel:(STCalendarKitDayModel*)copyDayModel;

/**
 点击了当前cell 中当前月的button

 @param calendarKitView calendarKitView description
 @param mainIndexPath mainIndexPath description
 @param itemIndexPath itemIndexPath description
 @param copyDayModel copyDayModel copy
 */
- (void)calendarKitViewDidclicTheCurrentMonthItem:(STCalendarKitView*)calendarKitView
                                 mainIndexPath:(NSIndexPath*)mainIndexPath
                                 itemIndexPath:(NSIndexPath*)itemIndexPath
                                  copyDayModel:(STCalendarKitDayModel*)copyDayModel;

/**
 点击了当前cell 中下一个月的button

 @param calendarKitView calendarKitView description
 @param mainIndexPath mainIndexPath description
 @param itemIndexPath itemIndexPath description
 @param copyDayModel copyDayModel copy
 */
- (void)calendarKitViewDidclicTheNextMonthItem:(STCalendarKitView*)calendarKitView
                                    mainIndexPath:(NSIndexPath*)mainIndexPath
                                    itemIndexPath:(NSIndexPath*)itemIndexPath
                                  copyDayModel:(STCalendarKitDayModel*)copyDayModel;
@end
@interface STCalendarKitView : UIView
@property(nonatomic,strong)STCalendarKitMonthModel            *currentMonthModel;//今日的月模型

@property(nonatomic,strong)NSIndexPath                        *slectedIndexPath;//被选中的位置

@property(nonatomic,assign,readonly)NSInteger            autoAddDataSouceNumbers;//每次自动增加多少个月的数据,默认 12

@property(nonatomic,assign,readonly)NSInteger            autoAddDataSouceLeftMonths;//当剩下多少个月会自动增加数据，比如当前加载了12个月的数据，autoAddDataSouceLeftMonths = 4 那么在滑动到12- 4 section的时候，就会增加 autoAddDataSouceNumbers 个月的数据  默认4

- (instancetype)init NS_UNAVAILABLE;

+ (instancetype)new NS_UNAVAILABLE;

- (instancetype)initWithFrame:(CGRect)frame delegate:(id<STCalendarKitViewDlegate>)delegate NS_DESIGNATED_INITIALIZER;

//提供刷新接口
- (void)reloadData;

- (void)scrollToNextMonth;

- (void)scrollToLastMonth;
//提供滑动到某个月接口

- (void)scrollTodate:(NSDate*)date;



//提供让某天被选中或者取消选中的接口
- (void)setSelected:(BOOL)selected fromDate:(NSDate*)date;
@end
